Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor baseUrl to fix exposing NEXT_PUBLIC_VERCEL_URL #1326

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

valiant1x
Copy link

@valiant1x valiant1x commented Apr 17, 2024

Description

  • NEXT_PUBLIC_VERCEL_URL is a long, internal looking domain that points to something like https://my-cool-name-h2134yh2-github-user-projects.vercel.app/. this ends up in robots.txt, sitemap, and the opengraph image URLs as part of the current app configuration, assuming you deploy with Vercel
  • the README and setup requirements already stipulate that TWITTER_URL points to the prod domain, so let's reuse that!
  • this PR refactors baseUrl to a global constant that considers vercel prod env and existing env var for prod URL (TWITTER_SITE)

fixes #1324

Copy link

vercel bot commented Apr 17, 2024

@valiant1x is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

@danieldanielecki
Copy link

@leerob

Copy link

vercel bot commented Jul 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
commerce-shopify ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 29, 2024 4:01am

@@ -29,3 +29,10 @@ export const TAGS = {
export const HIDDEN_PRODUCT_TAG = 'nextjs-frontend-hidden';
export const DEFAULT_OPTION = 'Default Title';
export const SHOPIFY_GRAPHQL_API_ENDPOINT = '/api/2023-01/graphql.json';

export const BASE_URL =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be able to use VERCEL_PROJECT_PRODUCTION_URL here now.

https://vercel.com/docs/projects/environment-variables/system-environment-variables#system-environment-variables

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump on this! Are you still interested in taking this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sitemap.xml & robots.txt points to Vercel's domain
3 participants